﻿@model CommerceOne.Widgets.Sorting.SortingViewModel
           
@if (Model != null && Model.SortingItems != null)
{
    <div class="product_sort">
    <form id="productsSortForm" >
        <select id="selectPrductSort" onchange="goto(this.value);">
            @foreach (var item in Model.SortingItems)
            {
                if (item.IsCurrent)
                {
                <option selected="selected" value="/@item.PostBackAddress">@item.Name</option>
                }
                else
                {
                <option value="/@item.PostBackAddress">@item.Name</option>
                }
            }
        </select>
        <label for="selectPrductSort">Sort by</label>
        <script>
            function goto(url) {
                parent.location = url;
            }
        </script>
        </form>
    </div>
}
